def create_app(config_path):
    from flask import Flask, request, jsonify
    app = Flask(__name__)
    app.config.from_pyfile(config_path)

    from .ext import cache, qyh
    cache.init_app(app)
    qyh.init_app(app)

    @app.route("/send", methods=["POST"])
    def send():
        res = qyh.send_text_message(
            request.form["agentid"], request.form["message"]
        )
        return jsonify(result=res)

    return app
